//
//  RecommendCell.m
//  INAlienLand
//
//  Created by wYz on 15/6/29.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "RecommendCell.h"

@implementation RecommendCell

- (void)dealloc{
    [self.type5tittle release];
    [self.imageview release];
    [self.Midlittle release];
    [self.Midtitlelabel release];
    [self.MidSubtittle release];
    [self.Firstdaylabel release];
    [self.Placename release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.imageview = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imageview];
        
        self.titlelabel = [[UILabel alloc]init];
        [self.imageview addSubview:self.titlelabel];
        
        self.Midlittle = [[UILabel alloc]init];
        [self.imageview addSubview:self.Midlittle];
        
        self.type5tittle = [[UILabel alloc]init];
        [self.imageview addSubview:self.type5tittle];
        
        self.Midtitlelabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.Midtitlelabel];
        
        self.MidSubtittle = [[UILabel alloc]init];
        [self.contentView addSubview:self.MidSubtittle];
        
        self.Firstdaylabel = [[UILabel alloc]init];
        [self.imageview addSubview:self.Firstdaylabel];
        
        self.Placename = [[UILabel alloc]init];
        [self.imageview addSubview:self.Placename];
        
        [self.Firstdaylabel release];
        [self.MidSubtittle release];
        [self.imageview release];
        [self.titlelabel release];
        [self.Midlittle release];
        [self.Midtitlelabel release];
        [self.Placename release];
    }
    
    
    return self;
    
    
}


- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.imageview.frame = CGRectMake(10, 5, self.contentView.frame.size.width-20, self.contentView.frame.size.height-10);
    self.imageview.layer.cornerRadius = 10;
    self.imageview.layer.masksToBounds = YES;
    
    self.titlelabel.frame = CGRectMake(15, 15, self.imageview.frame.size.width-30,self.contentView.frame.size.height/4);
    //设置字体大小
    self.titlelabel.font = [UIFont systemFontOfSize:20];
    self.titlelabel.textColor = [UIColor whiteColor];
    self.titlelabel.shadowColor = [UIColor grayColor];
    self.titlelabel.shadowOffset = CGSizeMake(1, 1);
    self.titlelabel.numberOfLines = 2;
    
    //type5和7
    self.Midtitlelabel.frame = CGRectMake(0, 30,self.contentView.frame.size.width, self.contentView.frame.size.height/10);
    self.Midtitlelabel.font = [UIFont systemFontOfSize:30];
    self.Midtitlelabel.textColor = [UIColor whiteColor];
    self.Midtitlelabel.shadowColor = [UIColor grayColor];
    self.Midtitlelabel.shadowOffset = CGSizeMake(1, 1);
    self.Midtitlelabel.textAlignment = NSTextAlignmentCenter;
    
    self.Midlittle.frame = CGRectMake(0, self.contentView.frame.size.height/3, self.contentView.frame.size.width, self.contentView.frame.size.height/5);
    self.Midlittle.font = [UIFont systemFontOfSize:15];
    self.Midlittle.textColor = [UIColor whiteColor];
    self.Midlittle.shadowColor = [UIColor grayColor];
    self.Midlittle.shadowOffset = CGSizeMake(1, 1);
    self.Midlittle.textAlignment = NSTextAlignmentCenter;
    
    //type7
    self.MidSubtittle.frame = CGRectMake(0, 30,self.contentView.frame.size.width, self.contentView.frame.size.width/10);
    self.MidSubtittle.font = [UIFont systemFontOfSize:30];
    self.MidSubtittle.textColor = [UIColor whiteColor];
    self.MidSubtittle.lineBreakMode = NSLineBreakByTruncatingMiddle;
    self.MidSubtittle.textAlignment = NSTextAlignmentCenter;
    
    
    self.Firstdaylabel.frame = CGRectMake(15, self.contentView.frame.size.width/3, self.contentView.frame.size.width/5, self.contentView.frame.size.width/15);
    self.Firstdaylabel.font = [UIFont systemFontOfSize:12];
    self.Firstdaylabel.textColor = [UIColor whiteColor];
    self.Firstdaylabel.shadowColor = [UIColor grayColor];
    self.Firstdaylabel.shadowOffset = CGSizeMake(1, 1);
    
    //
    self.Placename.frame = CGRectMake(15, self.contentView.frame.size.width/3+self.contentView.frame.size.width/15, self.contentView.frame.size.width/2, self.contentView.frame.size.width/15);
    self.Placename.font = [UIFont systemFontOfSize:12];
    self.Placename.textColor = [UIColor whiteColor];
    self.Placename.shadowColor = [UIColor grayColor];
    self.Placename.shadowOffset = CGSizeMake(1, 1);
    
    self.type5tittle.frame = CGRectMake(0, self.contentView.frame.size.height/3, self.contentView.frame.size.width, self.contentView.frame.size.height/5);
    self.type5tittle.font = [UIFont systemFontOfSize:15];
    self.type5tittle.textColor = [UIColor whiteColor];
    self.type5tittle.shadowColor = [UIColor grayColor];
    self.type5tittle.shadowOffset = CGSizeMake(1, 1);
    self.type5tittle.textAlignment = NSTextAlignmentCenter;
    
    
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
